// 配置编译环境和线上环境之间的切换
let baseUrl;

const env = process.env;

// 开发环境地址
if (env.NODE_ENV == "development") {
  baseUrl = {
    apiHostName: "http://192.168.0.231:8000/",
    wsUrl: "ws://192.168.0.231:8000/",
    oss: "https://zkms-emall-test.oss-cn-shenzhen.aliyuncs.com/"
  };
}
//生产环境地址
else if (env.NODE_ENV == "production") {
  baseUrl = {
    apiHostName: "http://192.168.0.231:8000/",
    wsUrl: "ws://192.168.0.231:8000/",
    oss: "https://zkms-emall-test.oss-cn-shenzhen.aliyuncs.com/"
  };
}
//测试环境地址
else if (env.NODE_ENV == "test") {
  baseUrl = {
    apiHostName: "http://192.168.0.231:8000/",
    wsUrl: "ws://192.168.0.231:8000/",
    oss: "https://zkms-emall-test.oss-cn-shenzhen.aliyuncs.com/"
  };
}
//预发布环境地址
else if (env.NODE_ENV == "pre") {
  baseUrl = {
    // apiHostName: "https://www.manytrader.com",
    // wsUrl: "wss://www.manytrader.com/",
    // oss: "https://zkms-emall-test.oss-cn-shenzhen.aliyuncs.com/"
    apiHostName: "http://120.77.148.73/",
    wsUrl: "ws://120.77.148.73/",
    oss: "https://zkms-emall-test.oss-cn-shenzhen.aliyuncs.com/"
  };
}

// process.env.HOST_NAME = baseUrl.apiHostName

module.exports = {
  baseUrl
};
